with FT2.Types; use FT2.Types;

package FT2.Errors is

   pragma Preelaborate;

   --  Generic errors
   FT_Err_Ok                        : constant FT_Error := 16#00#;
   FT_Err_Cannot_Open_Resource      : constant FT_Error := 16#01#;
   FT_Err_Unknown_File_Format       : constant FT_Error := 16#02#;
   FT_Err_Invalid_File_Format       : constant FT_Error := 16#03#;
   FT_Err_Invalid_Version           : constant FT_Error := 16#04#;
   FT_Err_Lower_Module_Version      : constant FT_Error := 16#05#;
   FT_Err_Invalid_Argument          : constant FT_Error := 16#06#;
   FT_Err_Unimplemented_Feature     : constant FT_Error := 16#07#;
   FT_Err_Invalid_Table             : constant FT_Error := 16#08#;
   FT_Err_Invalid_Offset            : constant FT_Error := 16#09#;
   FT_Err_Array_Too_Large           : constant FT_Error := 16#0A#;

   -- Glyph/character errors
   FT_Err_Invalid_Glyph_Index       : constant FT_Error := 16#10#;
   FT_Err_Invalid_Character_Code    : constant FT_Error := 16#11#;
   FT_Err_Invalid_Glyph_Format      : constant FT_Error := 16#12#;
   FT_Err_Cannot_Render_Glyph       : constant FT_Error := 16#13#;
   FT_Err_Invalid_Outline           : constant FT_Error := 16#14#;
   FT_Err_Invalid_Composite         : constant FT_Error := 16#15#;
   FT_Err_Too_Many_Hints            : constant FT_Error := 16#16#;
   FT_Err_Invalid_Pixel_Size        : constant FT_Error := 16#17#;

   -- Handle errors
   FT_Err_Invalid_Handle            : constant FT_Error := 16#20#;
   FT_Err_Invalid_Library_Handle    : constant FT_Error := 16#21#;
   FT_Err_Invalid_Driver_Handle     : constant FT_Error := 16#22#;
   FT_Err_Invalid_Face_Handle       : constant FT_Error := 16#23#;
   FT_Err_Invalid_Size_Handle       : constant FT_Error := 16#24#;
   FT_Err_Invalid_Slot_Handle       : constant FT_Error := 16#25#;
   FT_Err_Invalid_CharMap_Handle    : constant FT_Error := 16#26#;
   FT_Err_Invalid_Cache_Handle      : constant FT_Error := 16#27#;
   FT_Err_Invalid_Stream_Handle     : constant FT_Error := 16#28#;

   -- Driver errors
   FT_Err_Too_Many_Drivers          : constant FT_Error := 16#30#;
   FT_Err_Too_Many_Extensions       : constant FT_Error := 16#31#;

   -- Memory errors
   FT_Err_Out_Of_Memory             : constant FT_Error := 16#40#;
   FT_Err_Unlisted_Object           : constant FT_Error := 16#41#;

   -- Stream errors
   FT_Err_Cannot_Open_Stream        : constant FT_Error := 16#51#;
   FT_Err_Invalid_Stream_Seek       : constant FT_Error := 16#52#;
   FT_Err_Invalid_Stream_Skip       : constant FT_Error := 16#53#;
   FT_Err_Invalid_Stream_Read       : constant FT_Error := 16#54#;
   FT_Err_Invalid_Stream_Operation  : constant FT_Error := 16#55#;
   FT_Err_Invalid_Frame_Operation   : constant FT_Error := 16#56#;
   FT_Err_Nested_Frame_Access       : constant FT_Error := 16#57#;
   FT_Err_Invalid_Frame_Read        : constant FT_Error := 16#58#;

   -- Raster errors
   FT_Err_Raster_Uninitialized      : constant FT_Error := 16#60#;
   FT_Err_Raster_Corrupted          : constant FT_Error := 16#61#;
   FT_Err_Raster_Overflow           : constant FT_Error := 16#62#;
   FT_Err_Raster_Negative_Height    : constant FT_Error := 16#63#;

   -- Cache errors
   FT_Err_Too_Many_Caches           : constant FT_Error := 16#70#;

   -- TrueType and SFNT errors
   FT_Err_Invalid_Opcode            : constant FT_Error := 16#80#;
   FT_Err_Too_Few_Arguments         : constant FT_Error := 16#81#;
   FT_Err_Stack_Overflow            : constant FT_Error := 16#82#;
   FT_Err_Code_Overflow             : constant FT_Error := 16#83#;
   FT_Err_Bad_Argument              : constant FT_Error := 16#84#;
   FT_Err_Divide_By_Zero            : constant FT_Error := 16#85#;
   FT_Err_Invalid_Reference         : constant FT_Error := 16#86#;
   FT_Err_Debug_OpCode              : constant FT_Error := 16#87#;
   FT_Err_ENDF_In_Exec_Stream       : constant FT_Error := 16#88#;
   FT_Err_Nested_DEFS               : constant FT_Error := 16#89#;
   FT_Err_Invalid_CodeRange         : constant FT_Error := 16#8A#;
   FT_Err_Execution_Too_Long        : constant FT_Error := 16#8B#;
   FT_Err_Too_Many_Function_Defs    : constant FT_Error := 16#8C#;
   FT_Err_Too_Many_Instruction_Defs : constant FT_Error := 16#8D#;
   FT_Err_Table_Missing             : constant FT_Error := 16#8E#;
   FT_Err_Horiz_Header_Missing      : constant FT_Error := 16#8F#;
   FT_Err_Locations_Missing         : constant FT_Error := 16#90#;
   FT_Err_Name_Table_Missing        : constant FT_Error := 16#91#;
   FT_Err_CMap_Table_Missing        : constant FT_Error := 16#92#;
   FT_Err_Hmtx_Table_Missing        : constant FT_Error := 16#93#;
   FT_Err_Post_Table_Missing        : constant FT_Error := 16#94#;
   FT_Err_Invalid_Horiz_Metrics     : constant FT_Error := 16#95#;
   FT_Err_Invalid_CharMap_Format    : constant FT_Error := 16#96#;
   FT_Err_Invalid_PPem              : constant FT_Error := 16#97#;
   FT_Err_Invalid_Vert_Metrics      : constant FT_Error := 16#98#;
   FT_Err_Could_Not_Find_Context    : constant FT_Error := 16#99#;
   FT_Err_Invalid_Post_Table_Format : constant FT_Error := 16#9A#;
   FT_Err_Invalid_Post_Table        : constant FT_Error := 16#9B#;

   -- CFF, CID, and Type 1 errors
   FT_Err_Syntax_Error              : constant FT_Error := 16#A0#;
   FT_Err_Stack_Underflow           : constant FT_Error := 16#A1#;
   FT_Err_Ignore                    : constant FT_Error := 16#A2#;

   -- BDF errors
   FT_Err_Missing_Startfont_Field   : constant FT_Error := 16#B0#;
   FT_Err_Missing_Font_Field        : constant FT_Error := 16#B1#;
   FT_Err_Missing_Size_Field        : constant FT_Error := 16#B2#;
   FT_Err_Missing_Chars_Field       : constant FT_Error := 16#B3#;
   FT_Err_Missing_Startchar_Field   : constant FT_Error := 16#B4#;
   FT_Err_Missing_Encoding_Field    : constant FT_Error := 16#B5#;
   FT_Err_Missing_Bbx_Field         : constant FT_Error := 16#B6#;
   FT_Err_Bbx_Too_Big               : constant FT_Error := 16#B7#;
   FT_Err_Corrupted_Font_Header     : constant FT_Error := 16#B8#;
   FT_Err_Corrupted_Font_Glyphs     : constant FT_Error := 16#B9#;

end FT2.Errors;
